#pragma once
#include "tracker.h"
class YAddress;
class YUDPSocket;

class UDPTracker:
	public Tracker
{
public:
	UDPTracker(const char* host, unsigned short port);
	void connect();
	void announce();
	void scrap();

	void loop();
private:
	void onConnect(const char* buff, int len);
	void onAnnounce(const char* buff, int len);
	void onScrap(const char* buff, int len);
private:
	YUDPSocket* udpSocket;
	YAddress* mAddress;
};